package p270jp.pxv.android.activity;

import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import p014ae.AbstractActivityC0084g4;
import p014ae.C0100j9;
import p014ae.View$OnClickListenerC0046a;
import p014ae.View$OnClickListenerC0054c;
import p045be.IllustNoInfoRecyclerAdapter;
import p045be.WalkThroughAdapter;
import p062c4.ViewBindings;
import p072ce.ViewNovelAdItemBinding;
import p090d0.C2518n;
import p134ei.AnalyticsAction;
import p134ei.AnalyticsScreenName;
import p134ei.PixivAnalytics;
import p270jp.pxv.android.R;
import p270jp.pxv.android.view.PageControl;
import p393of.C5453b;
import p402om.WalkThroughIllustService;
import p427pm.WalkThroughSettings;
import p451qm.ItemDecoration;
import p569vd.C6830b;
import p645yc.AndroidSchedulers;
import p671zc.CompositeDisposable;

/* renamed from: jp.pxv.android.activity.WalkThroughActivity */
/* loaded from: classes2.dex */
public class WalkThroughActivity extends AbstractActivityC0084g4 {

    /* renamed from: C */
    public static final /* synthetic */ int f18737C = 0;

    /* renamed from: A */
    public PixivAnalytics f18738A;

    /* renamed from: B */
    public WalkThroughIllustService f18739B;

    /* renamed from: w */
    public IllustNoInfoRecyclerAdapter f18741w;

    /* renamed from: y */
    public boolean f18743y;

    /* renamed from: z */
    public ViewNovelAdItemBinding f18744z;

    /* renamed from: v */
    public final AnalyticsScreenName f18740v = AnalyticsScreenName.WALKTHROUGH;

    /* renamed from: x */
    public CompositeDisposable f18742x = new CompositeDisposable();

    @Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        View inflate = getLayoutInflater().inflate(R.layout.activity_walk_through, (ViewGroup) null, false);
        int i = R.id.page_control;
        PageControl pageControl = (PageControl) ViewBindings.m9835b(inflate, R.id.page_control);
        if (pageControl != null) {
            i = R.id.recycler_view;
            RecyclerView recyclerView = (RecyclerView) ViewBindings.m9835b(inflate, R.id.recycler_view);
            if (recyclerView != null) {
                i = R.id.view_pager;
                ViewPager viewPager = (ViewPager) ViewBindings.m9835b(inflate, R.id.view_pager);
                if (viewPager != null) {
                    i = R.id.walkthrough_menu_container;
                    LinearLayout linearLayout = (LinearLayout) ViewBindings.m9835b(inflate, R.id.walkthrough_menu_container);
                    if (linearLayout != null) {
                        i = R.id.walkthrough_next_text_view;
                        TextView textView = (TextView) ViewBindings.m9835b(inflate, R.id.walkthrough_next_text_view);
                        if (textView != null) {
                            i = R.id.walkthrough_skip_text_view;
                            TextView textView2 = (TextView) ViewBindings.m9835b(inflate, R.id.walkthrough_skip_text_view);
                            if (textView2 != null) {
                                RelativeLayout relativeLayout = (RelativeLayout) inflate;
                                this.f18744z = new ViewNovelAdItemBinding(relativeLayout, pageControl, recyclerView, viewPager, linearLayout, textView, textView2);
                                setContentView(relativeLayout);
                                this.f18738A = (PixivAnalytics) C2518n.m7641d(PixivAnalytics.class);
                                WalkThroughSettings aVar = (WalkThroughSettings) C2518n.m7641d(WalkThroughSettings.class);
                                this.f18739B = (WalkThroughIllustService) C2518n.m7641d(WalkThroughIllustService.class);
                                this.f18738A.m6525e(this.f18740v);
                                this.f18738A.m6528b(15, AnalyticsAction.NEW_USER_START_WALKTHROUGH);
                                WalkThroughAdapter n2Var = new WalkThroughAdapter(m11131K0());
                                ((ViewPager) this.f18744z.f5419h).setAdapter(n2Var);
                                ((ViewPager) this.f18744z.f5419h).m10517b(new p014ae.WalkThroughActivity(this, n2Var));
                                ViewNovelAdItemBinding fVar = this.f18744z;
                                ((PageControl) fVar.f5417f).setupWithViewPager((ViewPager) fVar.f5419h);
                                GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 2);
                                IllustNoInfoRecyclerAdapter uVar = new IllustNoInfoRecyclerAdapter(this, this.f936e);
                                this.f18741w = uVar;
                                uVar.f4644n = true;
                                ((RecyclerView) this.f18744z.f5418g).setLayoutManager(gridLayoutManager);
                                ((RecyclerView) this.f18744z.f5418g).m10871g(new ItemDecoration(this, gridLayoutManager));
                                ((RecyclerView) this.f18744z.f5418g).setAdapter(this.f18741w);
                                this.f18742x.mo82c(this.f18739B.m3213a().m966j(AndroidSchedulers.m334a()).m963m(new C6830b(this, 6), C0100j9.f419b));
                                this.f18744z.f5416e.setOnClickListener(new View$OnClickListenerC0046a(this, 7));
                                this.f18744z.f5415d.setOnClickListener(new View$OnClickListenerC0054c(this, 8));
                                return;
                            }
                        }
                    }
                }
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
    }

    @Override // p116e.ActivityC2727f, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        this.f18742x.m80f();
        super.onDestroy();
    }

    public void onWalkThroughNextTextViewClick(View view) {
        if (((ViewPager) this.f18744z.f5419h).getCurrentItem() + 1 < ((ViewPager) this.f18744z.f5419h).getAdapter().mo938c()) {
            Object obj = this.f18744z.f5419h;
            ((ViewPager) obj).setCurrentItem(((ViewPager) obj).getCurrentItem() + 1);
        }
    }

    public void onWalkThroughSkipTextViewClick(View view) {
        Object obj = this.f18744z.f5419h;
        ((ViewPager) obj).setCurrentItem(((ViewPager) obj).getAdapter().mo938c() - 1);
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        if (z) {
            C5453b.m3260s(this);
        }
    }
}
